<html>
<head>
    <meta charset="utf-8">
    <title>绑定后台</title>
    <#assign base=request.contextPath  />
    <#setting  number_format="0.##"/>

    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" href="${base}/frame/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${base}/sweep/css/app.css" media="all">
    <link rel="stylesheet" href="${base}/sweep/css/mui.min.css" media="all">
    <link rel="stylesheet" type="text/css" href="${base}/sweep/css/style.css" />
    <script src="${base}/backstage/js/jquery-1.8.3.min.js"></script>
    <script src="${base}/sweep/js/mui.min.js"></script>
    <script src="${base}/backstage/layui/layui.js"></script>
</head>
<body>
<form class="mui-input-group">
    <div class="mui-input-row">
        <label>后台Id</label>
        <input type="text" id="userInfoId" class="mui-input-clear" placeholder="请输入后台ID">
    </div>
    <div class="mui-button-row">
        <button type="button" class="mui-btn mui-btn-primary" id="saveButton">确认</button>
        <button type="button" class="mui-btn mui-btn-danger" id="fan">返回</button>
    </div>
</form>
</body>
<script>
    layui.use(['form', 'layer', 'upload'], function () {
        var form = layui.form
            , layer = layui.layer
            , $ = layui.jquery
            , upload = layui.upload;
    })
    $("#saveButton").one("click",function(){
        if ($("#userInfoId").val() == "") {
            mui.alert("请填写后台ID");
            return;
        }
        $.ajax({
            type: "POST", //提交方式
            url: "${base}/wx/user/updateByOpenId",//路径
            data: {openId:'${user.openid}',userInfoId:$("#userInfoId").val()},
            success: function (data) {//返回数据根据结果进行相应的处理
                if (data.code === 200) {
                    layer.msg(data.msg);
                    window.location.href="${base}/wx/user/personal.html";
                } else {
                    layer.msg(data.msg);
                }
            }
        });
    })
    $("#fan").one("click",function(){
        window.location.href="${base}/wx/user/personal.html";
    })
</script>

</html>


